<?php

namespace App\Http\Controllers\Seller;

use App\Library\KdClient;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class WuliuController extends BaseController
{
    public function index()
    {

    }

    public function detail(Request $request)
    {
        $order_id = $request->input('order_id');
        $order = $this->user()->solds()->with('shipping.express')->find($order_id);

        $client = new KdClient();
        $client->setShipperCode($order->shipping->express->code);
        $client->setLogisticCode($order->shipping->express_no);
        $traces = $client->sendRequest()->getTraces();



        return $this->view('seller.wuliu.detail', compact('order_id', 'order', 'traces'));
    }
}
